function h = vmd(obj,varargin)
%VMD plots atoms to a VMD interface


indexes = obj.Atoms.keys;


for k=1:numel(indexes)
    
  Atom = obj.Atoms(indexes{k});
  
  
  pdb_atoms(k) = struct('AtomSerNo',k,...
              'AtomName',{obj.specie{Atom.Specie}},...
              'altLoc',{''},...
              'resName',{''},...
              'chainID',{''},...
              'resSeq',{0},...
              'iCode',{''},...
              'X',Atom.Position(1),...
              'Y',Atom.Position(2),...
              'Z',Atom.Position(3),...
              'occupancy',{0},...
              'tempFactor',{0},...
              'segID',{''},...
              'element',{obj.specie{Atom.Specie}},...
              'charge',{''},...
              'AtomNameStruct',struct('chemSymbol',{''},...
                                      'remoteInd',{''},...
                                      'branch',{''}));
    
end

                                   
Model = struct('Atom',pdb_atoms);                                   
pdbstruct = struct('Model',Model);

h = molviewer(pdbstruct);

set(gcf,'Name',char(varargin{1}));

end